package org.imis181.moqilintong.model.binary;

import lombok.NoArgsConstructor;

/**
 * 计算两个数的和
 * @author moqilintong
 */
@NoArgsConstructor
public class Adder01 extends AbstractBinaryOperation01 {
    public Adder01(Double oprand1, Double oprand2) {
        super(oprand1, oprand2);
    }

    @Override
    public double getResult() {
        return oprand1 + oprand2;
    }

    @Override
    public String toString() {
        String template = "%f + %f = %f";
        return String.format(template, super.oprand1, super.oprand2, getResult());
    }
}
